<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
	var sta = 1;
	window.onload = function(){
		var btn = document.getElementById('btn');//抓到按钮
		var duminjun = document.getElementById('duminjun');//抓到都敏俊
		// btn.onclick = function(){
		// 	if(duminjun.style.display=='block'){
		// 		duminjun.style.display = 'none';
		// 	}else{
		// 		duminjun.style.display = 'block';
		// 	}
		// }

		// 方法二：
		btn.onclick = function(){
			if(sta==1){//如果sta等于1，那么就让图片隐藏
				duminjun.style.display = 'none';
				sta = 0;
			}else{
				duminjun.style.display = 'block';
				sta = 1;
			}
		}
		

	}
</script>
</head>

<body>

<input type="button" value="点我啊！" id="btn" />
<br /><br />

<img src="duminjun.jpg" id="duminjun" style="display:block;" />


</body>
</html>
